package com.study.d2_file;

import java.io.File;

public class Test4 {
    public static void main(String[] args) {
        //目标：File的遍历文件夹功能
        File file = new File("C:\\Users\\51230\\Desktop\\前端Xmind笔记");
        //获取一级文件名称
        String[] list = file.list();
        for (String s : list) {
            System.out.println(s);
        }
        System.out.println("========================================================");
        //获取一级文件对象
        File[] files = file.listFiles();
        for (File file1 : files) {
            System.out.println(file1.getAbsolutePath());
        }
    }
}
